import * as types from "../types/cart.types";

// 保存购物车列表
export const saveToCartCreator = (cart) => ({
  type: types.SAVE_TO_CART,
  payload: cart,
});

// 更新商品数量
export const updateGoodsCount = ({ count, id }) => ({
  type: types.UPDATE_GOODS_COUNT,
  payload: { count, id },
});

// 删除商品
export const deleteGoodsCreator = (id) => ({
  type: types.DELETE_GOODS,
  payload: id,
});
